<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
	<style type="text/css">
		body{
			font-size: large;
		}
		input{
			size: 20;
		}
	</style>
	<script src="http://code.jquery.com/jquery-1.7.js"></script>
	<script type="text/javascript">
		function update(){
			var pw = $("#pw").val();
			var repw = $("#repw").val();
			
			if(pw != repw){
				alert("재입력한 비밀번호가 동일하지 않습니다.\n다시 입력해주세요.");
			}else{
				$("#form").submit();
			}
		}
	</script>
</head>
<body>
	<center>
		<h2 align="center">회원 정보</h2>
		<hr>
	</center>
	<p>
	<form action="memberUpdate.do" method="post" id="form">
		<input type="text" name="m_id" value="${ memberInfo.m_id }" style="visibility: hidden;"/>
		<table align="center">
			<tr>
				<td>회원 아이디</td>
				<td>
					<b>${ memberInfo.m_id }</b>
				</td>
			</tr>
			<tr>
				<td>비밀번호</td>
				<td>
					<input type="password" id="pw" name="m_pw" size="21" value="${ memberInfo.m_pw }">
				</td>
			</tr>
			<tr>
				<td>비밀번호 확인</td>
				<td>
					<input type="password" id="repw" size="21">
				</td>
			</tr>
			<tr>
				<td>이름</td>
				<td>
					<input type="text" name="m_name" value="${ memberInfo.m_name }">
				</td>
			</tr>
			<tr>
				<td>주소</td>
				<td>
					<input type="text" name="m_addr" value="${ memberInfo.m_addr }">
				</td>
			</tr>
			<tr>
				<td>연락처</td>
				<td>
					<input type="text" name="m_tell" value="${ memberInfo.m_tell }">
				</td>
			</tr>
			<tr>
				<td>이메일</td>
				<td>
					<input type="text" name="m_email" value="${ memberInfo.m_email }">
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<br>
					<input type="button" value="수정" onclick="update();">
					<input type="button" value="탈퇴" onclick="location.href='deletemember.do?id=${ memberInfo.m_id }';">
					<input type="reset" value="취소">
					<input type="button" value="목록보기" onclick="location.href='listBoard.do';">
				</td>
			</tr>
		</table>
	</form>
</body>
</html>